@model IEnumerable<ProjectCodeS.Models.Company>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Name
        </th>
        <th>
            Street1
        </th>
        <th>
            Street2
        </th>
        <th>
            City
        </th>
        <th>
            State
        </th>
        <th>
            ZipCode
        </th>
        <th>
            Country
        </th>
        <th>
            Logo
        </th>
        <th>
            PhoneNumber1
        </th>
        <th>
            PhoneNumber2
        </th>
        <th>
            Stores
        </th>
        <th>
            Users
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
        <td>
			@item.Name
        </td>
        <td>
			@item.Street1
        </td>
        <td>
			@item.Street2
        </td>
        <td>
			@item.City
        </td>
        <td>
			@item.State
        </td>
        <td>
			@item.ZipCode
        </td>
        <td>
			@item.Country
        </td>
        <td>
			@item.Logo
        </td>
        <td>
			@item.PhoneNumber1
        </td>
        <td>
			@item.PhoneNumber2
        </td>
        <td>
			@(item.Stores == null ? "None" : item.Stores.Count.ToString())
        </td>
        <td>
			@(item.Users == null ? "None" : item.Users.Count.ToString())
        </td>
    </tr>
}

</table>


